<html>
<head>
    <title>Test For Ext JS Ajax</title>
    <meta charset="UTF-8">

    <link rel="stylesheet" type="text/css" href="ext-4.2.1.883/ext-all.js">
    <script type="text/javascript" src="ext-4.2.1.883/ext-all-debug.js"></script>
    <script type="text/javascript" src="ext-4.2.1.883/locale/ext-lang-zh_CN.js"></script>


</head>

<body>
<script type="text/javascript">
    var users2 = null;
    var users3 = null;

    function getJSON() {
        var text = null;
        var users1 = "aa";
        Ext.Ajax.request({
            url: 'user.json',
            params: {
                id: 1
            },
            success: function (response) {
                text = response.responseText;
//                alert(text);
                  users3 = eval("(" + text + ")");
//                var users1 ='{ "user":"lili"}';
//                var users2 = eval("(" + users1 + ")");
//                alert(users2);

//                document.getElementById("name").innerHTML = users.users[0].name;
//                document.getElementById("name").innerHTML = users.name
            }
        });
    }

    getJSON();


    function nono() {
        alert(typeof users3);
        document.getElementById("name").innerHTML = users3.users[0].name;
    }

</script>

<script type="text/javascript">
    alert("2" + text);
</script>

<p id="name"></p>

<p id="age"></p>

<button onclick="nono()">GET JSON</button>

</body>
</html>
